
import { createApp } from 'vue'
import 'normalize.css'
import 'assets/styles/index.scss'
import App from './App.vue'
import router from './router'
import store from './store'
import api from './apis'
import Vant from 'vant';
import { Lazyload } from 'vant';
import 'virtual:uno.css'
import 'vant/lib/index.css'
import { i18n, setLocales } from './lang'
import { WagmiPlugin } from '@wagmi/vue'
import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'
import config from '@/config'
const queryClient = new QueryClient()
const app = createApp(App)
// 挂载组件
app.use(Vant)

app.config.globalProperties.$api = api 
setLocales(localStorage.lang || 'tw')
// 挂载路由及状态存储
app.use(router).use(store).use(i18n).use(Lazyload).use(WagmiPlugin, { config: config.wagmiAdapter.wagmiConfig })
  .use(VueQueryPlugin, { queryClient })

app.mount('#app')
